package com.zlc.common.util.autocode;

import org.apache.commons.lang3.StringUtils;

/**
 * @Desc 基础路径配置
 * @author: zl
 * @date: 2022/3/27
 */
public class BasePath {

     public static final String BASE_PATH = "com\\zlc\\common\\core\\";

    /**
     * @Description: api统一生成规范
     * @return:
     * @Author: zhaoxinliang
     * @date: 2021/8/20
     */
    public static String getBaseTableHttpPath(String tableName) {
        String name = CodeDOM.StringUtil.camelCaseName(tableName);
        String s = name.replaceFirst("mayan", "Mayan");
        return s.replaceFirst("stone","Stone");
    }



    /**
     *  表关系设置
     * @Author: zl
     * @date: 2022/03/24
     */
    protected enum TableToPath {
        // 入参 表明 包名
//
//        T001("mayan_plat_user","user"),
//        T002("mayan_plat_login_user","user"),
//        T003("mayan_plat_dept","dept"),
//        T004("mayan_plat_dept_user","dept"),
//        T005("mayan_plat_role_class","role"),
//        T006("mayan_plat_role","role"),
//        T007("mayan_plat_role_user","role"),
//        T008("mayan_plat_data_role_config","role"),
//        T009("mayan_plat_user_work","role"),
//        T0010("mayan_plat_position","position"),
//        T0010("mayan_plat_dept_position","position"),
//        T0011("mayan_plat_position_role","position"),
//        T0012("mayan_plat_position_user","position"),
//        T0013("mayan_plat_system","resource"),
//        T0014("mayan_plat_system_resource","resource"),
//        T0015("mayan_plat_resource_role","resource"),
//        T0015("mayan_sys_log","sys"),
//        T0016("mayan_plat_dic","sys"),
//        T0017("stone_process","process"),
//        T0018("stone_process_class","process"),
//        T0019("stone_process_instance","process"),
//        T0020("stone_process_instance_history","process"),
//        T0021("stone_process_node","process"),
//        T0022("stone_task","process"),
//        T0024("stone_task_history","process"),
//        T0025("stone_event_config","process"),
//        T0026("stone_interface_config","process"),
//        T0027("stone_node_approve_config","process"),
//        T0028("stone_node_approve_user_config","process"),
//        T0029("stone_process_auth_config","process"),
//        T0030("stone_process_variable_config","process"),
//        T0031("stone_system","process"),
//        T0032("stone_interface_class","process"),
//        T0033("mayan_sys_config","sys"),
//        T0034("stone_process_form_config","process"),
        T0035("mayan_plat_user_agent","user"),

        ;

        private final String tableName;
        private final String modelPackage;
        private final String[] notNullSkipFiled = new String[]{};

        TableToPath(String tableName, String modelPackage) {
            this.tableName = tableName;
            this.modelPackage = modelPackage;
        }

        public static String[] getSkipFiledByTableName(String tableName) {
            TableToPath[] values = TableToPath.values();
            for (TableToPath value : values) {
                if (value.getTableName().equals(tableName)) {
                    return value.getNotNullSkipFiled();
                }
            }
            return new String[] {};
        }

        public String getTableName() {
            return tableName;
        }

        public String getModelPackage() {
            return modelPackage;
        }

        public String[] getNotNullSkipFiled() {
            return notNullSkipFiled;
        }

    }
}
